import getApiData from '@/services/cpasRequest';
export async function getFYFXList(params: {
  dbname: string;
  ROOTKMBH: string;
  KMBH: string;
  Data_ID: string;
  endTime: string;
  startTime: string;
  level: number;
  isLeaf?: boolean;
  amountField: string;
  isEnd: boolean;
  JC: number;
  hiddenEmptyData: boolean;
}) {
  if (!params.dbname)
    return Promise.resolve({
      data: [],
      success: false,
    });
  const res = await getApiData('Analysis.Inventory.FYFXGetList', params);
  if (res.ok) {
    return Promise.resolve({
      data: res.data,
      success: true,
    });
  }
  return Promise.resolve({
    data: [],
    success: false,
  });
}
